home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / metkit / mydlg.h < prev    next >
C/C++ Source or Header  |  1997-06-07  |  1KB  |  61 lines

  1. //    Copyright (C) 1996, 1997 Meta Four Software.  All rights reserved.
  2. //
  3. //    Display server sample code
  4. //
  5. //! rev="$Id: mydlg.h,v 1.3 1997/05/27 00:06:24 jcw Rel $"
  6.  
  7. /////////////////////////////////////////////////////////////////////////////
  8.  
  9. class CServer : public CSocket
  10. {
  11. public:
  12.     typedef void (*ConnectHandler)(CFile&);
  13.  
  14.     CServer (int port_, ConnectHandler handler_);
  15.     ~CServer ();
  16.  
  17.     virtual void OnAccept(int error_);
  18.     virtual void OnClose(int error_);
  19.  
  20. private:
  21.     int _port;
  22.     ConnectHandler _handler; // called when a new connection is opened
  23. };
  24.  
  25. // CMyDlg dialog
  26.  
  27. class CMyDlg : public CDialog
  28. {
  29. // Construction
  30. public:
  31.     CMyDlg (CWnd* pParent = NULL);    // standard constructor
  32.     ~CMyDlg ();
  33.  
  34. // Dialog Data
  35.     //{{AFX_DATA(CMyDlg)
  36.     enum { IDD = IDD_CATRECV_DIALOG };
  37.     CEdit    m_port;
  38.     //}}AFX_DATA
  39.  
  40.     // ClassWizard generated virtual function overrides
  41.     //{{AFX_VIRTUAL(CMyDlg)
  42.     protected:
  43.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  44.     //}}AFX_VIRTUAL
  45.  
  46. // Implementation
  47. protected:
  48.     int _timer;
  49.     CServer* _server;
  50.  
  51.     // Generated message map functions
  52.     //{{AFX_MSG(CMyDlg)
  53.     virtual BOOL OnInitDialog();
  54.     afx_msg void OnChangePort();
  55.     afx_msg void OnTimer(UINT nIDEvent);
  56.     //}}AFX_MSG
  57.     DECLARE_MESSAGE_MAP()
  58. };
  59.  
  60. /////////////////////////////////////////////////////////////////////////////
  61.